<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>路由routing</title>
    <script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
    <script src="http://apps.bdimg.com/libs/angular-route/1.3.13/angular-route.js"></script>
</head>
<body>
    <div ng-app="routingApp01">
        <h2>AngularJs 路由</h2>
        <ul>
            <li><a href="#/home">首页</a></li>
            <li><a href="#/computers">电脑</a></li>
            <li><a href="#/printers">打印机</a></li>
            <li><a href="#/blabla">其它</a></li>
        </ul>
        <div ng-view></div>
    </div>
    <script>
        angular.module('routingApp01',['ngRoute'])
            .config(['$routeProvider', function($routeProvider){
                $routeProvider
                    .when('/',{template:'这是首页页面'})
                    .when('/computers',{template:'这是电脑分类页面'})
                    .when('/printers',{template:'这是打印机页面'})
                    .otherwise({redirectTo:'/'});
            }]);
    </script>
</body>
</html>